<table class="am-table am-table-bordered am-table-striped am-table-compact" id="result-table">
    <thead>
    <tr>
      <th width="80px">号码</th>
      <th width="50px">头像</th>
      <th width="120px">名称</th>
      <th width="100px">游戏</th>
      <th width="70px">成员数量</th>
      <th width="70px">抽佣比例</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    </tbody>
</table>
<style type="text/css">
    #result-table img {
        width: 50px;
        height: 50px;
    }
</style>

<script>
    // 等待一切就绪
    waitOk(function() {
        GroupUtil.fee(function(fee) {
            var list = GroupUtil.myGroups;
            var table = $("#result-table tbody");
            table.empty();

            for (var i in list) {
                var g = list[i];
                if (g.owner != context.user.user.id) continue;
                var tr = $("<tr></tr>");
                tr.append('<td>' + g.code + "</td>");
                tr.append('<td><img src="' + g.portrait + '"/></td>');
                tr.append('<td>' + g.name + "</td>");
                tr.append('<td>' + (g.lottery ? get_game_display_name(g.lottery) : "无") + '</td>');
                tr.append('<td>' + g.member + "</td>");
                if (g.fee)
                    tr.append('<td>' + (g.fee*100 + "%") + "</td>");
                else
                    tr.append('<td>' + (fee*100 + "%") + "</td>");
                tr.append('<td value="' + g.id + '"> <button class="switch">切换</button> </td>');
                table.append(tr);
            }

            $("#result-table button").click(function(e) {
                switchToGroup($(e.currentTarget).parent().attr("value"));
            });
        });
    });

    function switchToGroup(id) {
        urlInfo.params.group = id;
        Util.jumpUrl({
            n1: "群信息设置",
            n2: "基础信息",
        });
    }
</script>
   